package com.example.comment_oa.pojos;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 
 * @TableName mobility
 */
@TableName(value ="mobility")
@Data
public class Mobility implements Serializable {
    /**
     * 主键
     */
    @TableId(type = IdType.AUTO)
    private Integer mobId;

    /**
     * 申请人
     */
    private String mobName;

    /**
     * 原部门
     */
    private String mobDepartment;

    /**
     * 原上级
     */
    private String mobHigherUp;

    /**
     * 原岗位
     */
    private String mobPost;

    /**
     * 新部门
     */
    private String newDepartment;

    /**
     * 新上级
     */
    private String newHigherUp;

    /**
     * 新岗位
     */
    private String newPost;

    /**
     * 调动日期
     */
    private Date transferDate;

    /**
     * 调动原因
     */
    private String transferCause;

    /**
     * 流程状态、待发起0、审批中1、审批成功2、审批失败3
     */
    private Integer mobState;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Mobility other = (Mobility) that;
        return (this.getMobId() == null ? other.getMobId() == null : this.getMobId().equals(other.getMobId()))
            && (this.getMobName() == null ? other.getMobName() == null : this.getMobName().equals(other.getMobName()))
            && (this.getMobDepartment() == null ? other.getMobDepartment() == null : this.getMobDepartment().equals(other.getMobDepartment()))
            && (this.getMobHigherUp() == null ? other.getMobHigherUp() == null : this.getMobHigherUp().equals(other.getMobHigherUp()))
            && (this.getMobPost() == null ? other.getMobPost() == null : this.getMobPost().equals(other.getMobPost()))
            && (this.getNewDepartment() == null ? other.getNewDepartment() == null : this.getNewDepartment().equals(other.getNewDepartment()))
            && (this.getNewHigherUp() == null ? other.getNewHigherUp() == null : this.getNewHigherUp().equals(other.getNewHigherUp()))
            && (this.getNewPost() == null ? other.getNewPost() == null : this.getNewPost().equals(other.getNewPost()))
            && (this.getTransferDate() == null ? other.getTransferDate() == null : this.getTransferDate().equals(other.getTransferDate()))
            && (this.getTransferCause() == null ? other.getTransferCause() == null : this.getTransferCause().equals(other.getTransferCause()))
            && (this.getMobState() == null ? other.getMobState() == null : this.getMobState().equals(other.getMobState()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getMobId() == null) ? 0 : getMobId().hashCode());
        result = prime * result + ((getMobName() == null) ? 0 : getMobName().hashCode());
        result = prime * result + ((getMobDepartment() == null) ? 0 : getMobDepartment().hashCode());
        result = prime * result + ((getMobHigherUp() == null) ? 0 : getMobHigherUp().hashCode());
        result = prime * result + ((getMobPost() == null) ? 0 : getMobPost().hashCode());
        result = prime * result + ((getNewDepartment() == null) ? 0 : getNewDepartment().hashCode());
        result = prime * result + ((getNewHigherUp() == null) ? 0 : getNewHigherUp().hashCode());
        result = prime * result + ((getNewPost() == null) ? 0 : getNewPost().hashCode());
        result = prime * result + ((getTransferDate() == null) ? 0 : getTransferDate().hashCode());
        result = prime * result + ((getTransferCause() == null) ? 0 : getTransferCause().hashCode());
        result = prime * result + ((getMobState() == null) ? 0 : getMobState().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", mobId=").append(mobId);
        sb.append(", mobName=").append(mobName);
        sb.append(", mobDepartment=").append(mobDepartment);
        sb.append(", mobHigherUp=").append(mobHigherUp);
        sb.append(", mobPost=").append(mobPost);
        sb.append(", newDepartment=").append(newDepartment);
        sb.append(", newHigherUp=").append(newHigherUp);
        sb.append(", newPost=").append(newPost);
        sb.append(", transferDate=").append(transferDate);
        sb.append(", transferCause=").append(transferCause);
        sb.append(", mobState=").append(mobState);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}